#include <iostream>
#include <fstream>

int main (int argc, char* argv[])
{
	double s = 30.0;
	double m = 250.0;
	double a = 10.0;

	double v = 0.0;
	double t = 0.0;
	double dt = 0.01;

	std::fstream file("output.csv", std::ios_base::out | std::ios_base::trunc);
	file << "#\tt\ts\tv" << std::endl;

	while(s > 0.0) {
		t+=dt;
		v+=dt*a;
		s-=dt*v;
		file << "\t" << t << "\t" << s << "\t" << v << std::endl;
	}
	std::cout << "t: " << t << "; s: " << s << "; v: " << v << ";" << std::endl;

	file.close();
}